package com.giscloud.amp.entity.vo;

import cn.hutool.core.date.DateUtil;
import com.giscloud.amp.entity.AmpAuth;


/**
 * @Author:gxd
 * @Description:
 * @Date: 9:56 2018/3/1
 * @Modified By:
 */
public class AmpAuthVO extends AmpAuth {
    private String createdDtDesc;
    private String statusCdDesc;
    private String authTypeDesc;
    public String getCreatedDtDesc() {
        if(super.getCreatedDt() != null){
            return DateUtil.format(super.getCreatedDt(),"yyyy-MM-dd");
        }
        return "";
    }

    public void setCreatedDtDesc(String createdDtDesc) {
        this.createdDtDesc = createdDtDesc;
    }

    public String getStatusCdDesc() {
        if (getStatusCd()==1) {
            return "在用";
        } else if (getStatusCd()==2) {
            return "删除";
        } else {
            return "";
        }
    }

    public void setStatusCdDesc(String statusCdDesc) {
        this.statusCdDesc = statusCdDesc;
    }

    public String getAuthTypeDesc() {
        if (getAuthType().equals("expand")) {
            return "根节点";
        } else if (getAuthType().equals("url")) {
            return "菜单";
        } else if (getAuthType().equals("button")){
            return "按钮";
        }else if (getAuthType().equals("auth")){
            return "权限";
        }else {
            return "其他";
        }
    }

    public void setAuthTypeDesc(String authTypeDesc) {
        this.authTypeDesc = authTypeDesc;
    }
}
